USE [SistemaDeLeiloes]
GO
/****** Object:  StoredProcedure [dbo].[sp_getLeiloes]    Script Date: 26/05/2014 02:55:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[sp_getLeiloes]
AS
BEGIN
	SET NOCOUNT ON;

	SELECT	l.*,
			p.nome,
			p.descricao,
			u.nome,
			u.email,
			u.cpf,
			u.rg,
			u.senha,
			u.telefone,
			u.endereco,
			u.perfil
	FROM leiloes l 
		INNER JOIN produtos p ON l.idProduto = p.id 
		INNER JOIN usuario u ON l.idUsuario = u.id
	WHERE l.status = 0

END
